Allow a domain other than Domain-0 to be a backend.
authortkuik@tkuik-lnx2.cisco.com <tkuik@tkuik-lnx2.cisco.com>
Mon, 3 Apr 2006 17:23:00 +0000 (18:23 +0100)
committertkuik@tkuik-lnx2.cisco.com <tkuik@tkuik-lnx2.cisco.com>
Mon, 3 Apr 2006 17:23:00 +0000 (18:23 +0100)
Signed-off-by: Tim Kuik tkuik@cisco.com
tools/python/xen/xend/server/DevController.py

index 6faadeb24ecf34f30e5cde327252c959515352ba..0424e89ed7c43b0cc46cdeaf7948f2addd189166 100644 (file)
@@ -85,6 +85,13 @@ class DevController:
                                                      front)
 
         import xen.xend.XendDomain
+        xd = xen.xend.XendDomain.instance()
+        backdom_name = sxp.child_value(config, 'backend')
+        if backdom_name is None:
+            backdom = xen.xend.XendDomain.PRIV_DOMAIN
+        else:
+            bd = xd.domain_lookup_by_name_nr(backdom_name)
+            backdom = bd.getDomid()
         count = 0
         while True:
             t = xstransact()
@@ -112,9 +119,13 @@ class DevController:
 
                 t.mkdir(backpath)
                 t.set_permissions(backpath,
-                                  {'dom': xen.xend.XendDomain.PRIV_DOMAIN },
+                                  {'dom': backdom },
                                   {'dom'  : self.vm.getDomid(),
                                    'read' : True })
+                t.mkdir(frontpath)
+                t.set_permissions(frontpath,
+                                  {'dom': self.vm.getDomid()},
+                                  {'dom': backdom, 'read': True})
 
                 t.write2(frontpath, front)
                 t.write2(backpath,  back)